package com.wms.controller;

import com.wms.entity.WStock;
import com.wms.mytool.Result;
import com.wms.service.WStockService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 仓库库存表(WStock)表控制层
 *
 * @author Li Xiaoyu
 * @since 2023-10-20 17:21:06
 */
@RestController
@RequestMapping("wStock")
public class WStockController {
    /**
     * 服务对象
     */
    @Resource
    private WStockService wStockService;

    /**
     * 查询所有仓库库存
     * @return 实例对象
     */
    @GetMapping("selectAllStock")
    public Result selectAllStock(){
        return this.wStockService.selectAllStock();
    }
    @GetMapping("{sid}")
    public Result selectAll(@PathVariable("sid") Integer sid){
        return this.wStockService.selectBySid(sid);
    }
    /**
     * 修改仓库商品库存量
     * @param wStock 商品库存对象
     * @return 实例对象
     */
    @PutMapping("updateStock")
    public Result updateStock(@RequestBody WStock wStock){
        return this.wStockService.updateStock(wStock);
    }
}

